/* 这个文件来放置主界面中的样式 */

.client-container {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main {
    width: 1000px;
    height: 740px;
    background-color: rgb(238, 238, 238);
    border-radius: 5px;

    display: flex;

    z-index: 2;
}

.main .left {
    width: 280px;
    height: 100%;
    background-color: rgb(46, 50, 56);

    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

.main .right {
    width: 720px;
    height: 100%;

    padding: 0 20px;
}

.cover {
    width: 100%;
    height: 100%;

    background-image: url(../img/cat.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;

    /* 为了让 .cover 和 .main 能够重叠, 给 .cover 加上个定位属性 */
    position: absolute;
    top: 0;
    left: 0;

    /* 设置了下 z 轴坐标 */
    z-index: 1;

    /* 使用 css 滤镜效果, 让背景图变的朦胧起来 */
    filter: blur(20px);
}

.main .left .user {
    height: 80px;
    font-size: 20px;
    line-height: 80px;
    color: white;
    padding: 0 20px;
}

.main .left .search {
    height: 40px;
    padding: 0 20px;

    /* 使用弹性布局, 让里面的元素, 水平方向排列 */
    display: flex;
    justify-content: center;
    align-items: center;
}


.main .left .search input {
    height: 34px;
    width: 200px;
    line-height: 34px;
    font-size: 14px;
    color: white;
    background-color: rgb(38, 41, 46);

    /* 去除边框和轮廓线 */
    border: none;
    outline: none;
    /* 输入框里的文字和左侧边界有个边距 */
    padding-left: 10px;

    border-radius: 5px;
}

.main .left .search button {
    height: 34px;
    width: 34px;
    border: none;
    outline: none;

    background-color: rgb(38, 41, 46);

    border-radius: 5px;
    background-image: url(../img/搜索.png);
    background-repeat: no-repeat;
    background-size: 20px 20px;
    background-position: center center;
}

.main .left .search button:active {
    background-color: grey;
}

.main .left .tab {
    height: 50px;
    display: flex;
    align-items: center;
}

.main .left .tab .tab-session {
    height: 100%;
    width: 50%;

    background-image: url(../img/对话.png);
    background-repeat: no-repeat;
    background-size: 30px 30px;
    background-position: center center;
}


.main .left .tab .tab-friend {
    height: 100%;
    width: 50%;

    background-image: url(../img/用户2.png);
    background-repeat: no-repeat;
    background-size: 30px 30px;
    background-position: center center;
}

.main .left .list {
    height: 570px;

    /* 如果里面的内容太多了, 就自动提供一个滚动条 */
    overflow: auto;
}

.main .left .list li {
    height: 60px;
    padding: 10px 20px;
    color: white;
    border-top: 1px solid black;
}

.main .left .list .selected {
    background-color: rgb(46, 54, 65);
}

/* 这个样式是给会话列表使用的 */
.main .left .list li h3,
.main .left .list li p {
    height: 20px;
    font-size: 14px;
    line-height: 20px;
}

/* 这个样式是给好友列表使用的 */
.main .left .list li h4 {
    height: 40px;
    line-height: 40px;
    font-size: 20px;
}

/* 应用了这个 css 类的元素就会被自动隐藏 */
.hide {
    display: none;
}

/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: none;
}

.main .right .title {
    height: 50px;
    line-height: 50px;
    font-size: 20px;
    text-align: center;
    border-bottom: 1px solid #ccc;
}

.main .right .message-show {
    height: 550px;

    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;

    /* 内容太多, 自动进行滚动 */
    overflow: auto;
}

.main .right .message-show .message {
    margin-top: 10px;
    /* 宽度默认 100%, 高度的话不显式设定, 后续一条消息的内容有多有少 */
    display: flex;
}

/* 这个样式让子元素靠左 */
.main .right .message-show .message-left {
    justify-content: flex-start;
}

/* 这个样式让子元素靠右 */
.main .right .message-show .message-right {
    justify-content: flex-end;
}

.main .right .message-show .message .box {
    /* box 凸显出左右这样的效果, 宽度不能是 100% */
    width: 500px;
}

.main .right .message-show .message .box h4 {
    /* 去掉加粗效果 */
    font-weight: normal;
    height: 20px;
    line-height: 20px;
    font-size: 16px;
}

.main .right .message-show .message .box p {
    padding: 20px;
    border-radius: 10px;
}

/* 给左侧右侧消息设置背景色 */
.main .right .message-show .message-left .box p {
    background-color: #fff;
}

.main .right .message-show .message-right .box p {
    background-color: rgb(123, 181, 107);
}

.main .right .message-input {
    /* 先把 textarea 转成块级元素, 方便设置尺寸啥的 */
    display: block;
    width: 100%;
    height: 100px;
    border: none;
    outline: none;

    margin-top: 2px;
    background-color: rgb(238, 238, 238);
    padding: 10px;
    resize: none;
}

.main .right .ctrl {
    height: 35px;
    display: flex;
    justify-content: flex-end;
}

.main .right .ctrl button {
    height: 35px;
    width: 100px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.main .right .ctrl button:active {
    background-color: grey;
    color: white;
}
/* 用户信息 */
.user {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.user h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

/* 搜索框 */
.search {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.search input {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
}

.search button {
    margin-left: 10px;
    padding: 8px 16px;
    font-size: 14px;
    color: #fff;
    background-color: #6a11cb;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search button:hover {
    background-color: #2575fc;
}

/* 添加好友按钮 */
.add-friend {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.add-friend button {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    color: #fff;
    background-color: #28a745;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.add-friend button:hover {
    background-color: #218838;
}

/* 退出登录按钮 */
.logout-container {
    position: absolute;
    top: 10px;
    right: 10px;
}

.logout-container button {
    padding: 8px 16px;
    font-size: 14px;
    color: #fff;
    background-color: #dc3545;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-container button:hover {
    background-color: #c82333;
}

/* 聊天标题和添加成员按钮的容器 */
.chat-header {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #ccc;
    background-color: #f9f9f9;
}

/* 聊天标题 */
#chatTitle {
    margin: 0;
    font-size: 20px;
    color: #333;
}

/* 添加成员按钮 */
.add-member-btn {
    padding: 8px 16px;
    font-size: 14px;
    color: #fff;
    background-color: #3498db;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.add-member-btn:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.add-member-btn:active {
    background-color: #1c6ea4;
    transform: scale(0.95);
}

  .add-member-btn {
    margin-left: 10px;
    padding: 6px 12px;
    background-color: #409EFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  .add-member-btn:hover {
    background-color: #66b1ff;
  }

  .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
  }

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.friend-popup {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.friend-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.friend-row button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.close-btn {
    margin-top: 15px;
    background-color: #aaa;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.message-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.revoke-btn {
    background-color: #f44336; /* 红色背景 */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
}

.revoke-btn:hover {
    background-color: #d32f2f; /* 撤回按钮的 hover 效果 */
}

.box {
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 5px;
    max-width: 70%;
}

.message img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
}

